/*-----------------------------------------------------------------------------
	The contents of this file are subject to the Mozilla Public License
	Version 1.1 (the "License"); you may not use this file except in
	compliance with the License. You may obtain a copy of the License at
	http://www.mozilla.org/MPL/
	
	Software distributed under the License is distributed on an "AS IS"
	basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
	License for the specific language governing rights and limitations
	under the License.
	
	The Original Code is Fever Framework code.
	
	The Initial Developer of the Original Code is Romain Ecarnot.
	Portions created by Initial Developer are Copyright (C) 2006
	the Initial Developer. All Rights Reserved.
	
	Contributor(s):
	
	Unless required by applicable law or agreed to in writing, software
	distributed under the License is distributed on an "AS IS" BASIS,
	WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
	See the License for the specific language governing permissions and
	limitations under the License.
-----------------------------------------------------------------------------*/

import org.aswing.ASColor;
import org.aswing.Component;
import org.aswing.graphics.Graphics;
import org.aswing.graphics.SolidBrush;
import org.aswing.Icon;

/**
 * Default icon used in {@link fvaswing.components.FvFileChooser} 
 * component to display 'home' button.
 * 
 * <p>You can find better icon in Fever SVN repository at
 * http://as2fever.googlecode.com/svn/trunk/aswing_extensions/assets/
 *
 * @author Romain Ecarnot
 */
class fvaswing.components.filechooser.icons.FvHomeIcon implements Icon
{
	//-------------------------------------------------------------------------
	// Private properties
	//-------------------------------------------------------------------------
		
	private var _color : ASColor;
	private var _width : Number;
	private var _height : Number;
	
	
	//-------------------------------------------------------------------------
	// Public API
	//-------------------------------------------------------------------------
	
	/**
	 * Constructor.
	 */
	public function FvHomeIcon( )
	{
		_color = new ASColor( 0x62A4D6, 100 );
		_width = 14;
		_height = 14;
	}
	
	/**
	 * Return the icon's width.
	 */
	public function getIconWidth() : Number
	{
		return _width;
	}
	
	/**
	 * Return the icon's height.
	 */
	public function getIconHeight() : Number
	{
		return _height;
	}

	/**
	 * Draws the icon at the specified component's specified location with the graphics.
	 * If this if the first time to paint on the specified component, there 
	 * may need some install operation, for example create MC on the
	 * specified mc if needed.
	 * 
	 * @param com component for which this border is being painted 
	 * @param g the paint graphics
	 * @param x the x corrdinate of the icon(top left of bounds)
	 * @param y the y corrdinate of the icon(top left of bounds)
	 */
	public function paintIcon(com : Component, g : Graphics, x : Number, y : Number) : Void
	{
		g.fillRectangle( new SolidBrush( _color ), x, y, _width, _height );
	}
	
	/**
	 * Remove things in the icon object related to the component.
	 */
	public function uninstallIcon(com : Component) : Void
	{
		
	}

}